<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>创建评价</title>
    <t:base type="ckeditor,jquery,easyui,tools,DatePicker"></t:base>
    <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css"/>
    <script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
    <script>
        $(function () {
            $("#code").bind("input propertychange", function () {
                var code = $("#code").val(); //服务单号
                if(code!=""){
                    $.ajax({
                        type: "post",
                        url: "inspectionWx.do?doFindType",
                        data: { 'ServiceId': code },
                        dataType: "json",
                        success: function (data) {
                            if (data.success) {
                                //判断服务单类型
                                var type=data.attributes['type'];
                                if (type == 'xunj') {   //巡检
                                    $("#busType").val("type_1");
                                }else if (type == 'weix') {   //维修
                                    $("#busType").val("type_2");
                                }else if (type == 'tous') {   //投诉
                                    $("#busType").val("type_3");
                                }else if (type == 'other') {   //其他
                                    $("#busType").val("type_4");
                                }
                            }else{
                                tip(data.msg);
                                return false;
                            }
                        }
                    });
                }

            });
        });


        function jiaoyan() {
            var value = $("#name").val();
            if (value == "") {
                tip("请选择影院名称！");
                return false;
            }
            var value = $("#busType option:selected").attr("value");
            if (value == "") {
                tip("请选择类别！");
                return false;
            }
        }
    </script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table"
             action="inspectionWx.do?doAdd" tiptype="1" beforeSubmit="jiaoyan">
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="30%">
                <label>服务单号:</label>
            </td>
            <td width="70%">
                <input name="code" id="code"/>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="30%">
                <label>服务类型<label style="color: red;">*</label>:</label>
            </td>
            <td width="70%">
                <t:dictSelect field="busType" id="busType" type="select" typeGroupCode="<%=StaticValue.DIC_EVALUATE_BUS_TYPE %>" defaultVal="" />
            </td>
        </tr>
        <tr>
            <td class="al_r" width="30%">
                <label>影院名称<label style="color: red;">*</label>:</label>
            </td>
            <td width="70%">
                <input name="belongCinemaId" type="hidden" id="belongCinemaId" >
                <input class="inputxt" id="name" readonly="readonly" style="width:260px;" dataType="*" nullmsg="请选择所属影院"/>
                <t:choose hiddenName="belongCinemaId" hiddenid="id" url="zyCinemaController.do?zyChooseCinemasForEs" name="cinemaList" icon="icon-search" title="影院列表" textname="name" isclear="true" height="500px" />
            </td>
        </tr>
        <tr>
            <td class="al_r" width="30%" valign="top">
                <label>联系人姓名<label style="color: red;">*</label>:</label>
            </td>
            <td width="70%">
                <input id="linkman" name="linkman" placeholder="填写联系人姓名" nullMsg="联系人名称不能为空！" datatype="*"/>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="30%" valign="top">
                <label>联系人电话<label style="color: red;">*</label>:</label>
            </td>
            <td width="70%">
                <input id="linkphone" name="linkphone" placeholder="填写联系人电话" nullMsg="联系人电话不能为空！" datatype="cPhone" errormsg="请正确填写电话"/>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="30%" valign="top">
                <label>备注:</label>
            </td>
            <td width="70%">
                <textarea style="width: 374px; height: 210px; margin: 0px;" name="remark" id="remark"></textarea>
            </td>
        </tr>
        </tbody>
    </table>
</t:formvalid>
</body>
</html>